package commons.operation;

import static commons.Preconditions.checkNotNull;

import java.util.Map;

public class Operation {

	private final OperationType						type;
	private final Map<OperationParameter, Object>	parameters;

	public Operation(final OperationType type,
						final Map<OperationParameter, Object> parameters) {

		checkNotNull("type must not be null", type);
		checkNotNull("parameters must not be null", parameters);

		this.type = type;
		this.parameters = parameters;
	}

	public Object getParameter(final OperationParameter parameter) {
		return parameters.get(parameter);
	}

	public OperationType type() {
		return type;
	}
}
